Skip to content

feat: support safe ovs bridge rename adoption#172

Draft
gboutry wants to merge 1 commit intocanonical:mainfrom
gboutry:feat/safe-bridge-rename
Draft

feat: support safe ovs bridge rename adoption#172
gboutry wants to merge 1 commit intocanonical:mainfrom
gboutry:feat/safe-bridge-rename

Conversation

@gboutry
Copy link
Copy Markdown
Collaborator

@gboutry gboutry commented Apr 9, 2026

Teach OVSCli to decide whether bridge renames are safe by checking local OVN Southbound bindings. When the chassis has no bindings, the external networking setup can replace an old bridge with the configured target bridge and adopt a pre-existing OVS bridge from bridge-mapping, including MAAS-created bridges when they are compatible.

Keep the autonomous hook path fail-closed when OVS or authoritative SB state cannot be read. Add an explicit hypervisor setup-bridge override for operators who need to allow stale SB reads against relay-backed deployments.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds OVN Southbound-based safety checks to decide when external OVS bridges can be safely replaced/adopted during bridge-mapping renames, with an operator CLI override to allow stale SB reads when needed.

Changes:

  • Introduce is_bridge_rename_safe() and an OVNSBCli helper to determine rename safety by checking local chassis bindings in OVN SB.
  • Update _configure_ovn_external_networking() to adopt/recreate bridges on safe rename scenarios (including adopting compatible pre-existing bridges).
  • Add hypervisor setup-bridge CLI command with --allow-stale-sb-read and expand unit test coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openstack_hypervisor/bridge_datapath.py Adds OVN SB client + rename safety logic used to gate destructive bridge changes.
openstack_hypervisor/hooks.py Uses rename-safety signal to adopt/recreate bridges and adds adoption helpers.
openstack_hypervisor/cli/hypervisor.py Adds setup-bridge command and passes stale-read override into networking setup.
tests/unit/test_bridge_datapath.py Adds focused tests for rename safety decisions and SB retry behavior.
tests/unit/test_hooks.py Adds tests for safe/unsafe rename behavior and bridge adoption paths.
tests/unit/cli/test_hypervisor.py Adds tests for setup-bridge default behavior and stale-read flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openstack_hypervisor/bridge_datapath.py Outdated
Comment thread openstack_hypervisor/bridge_datapath.py Outdated
Teach OVSCli to decide whether bridge renames are safe by checking
local OVN Southbound bindings. When the chassis has no bindings, the
external networking setup can replace an old bridge with the configured
target bridge and adopt a pre-existing OVS bridge from bridge-mapping,
including MAAS-created bridges when they are compatible.

Keep the autonomous hook path fail-closed when OVS or authoritative SB
state cannot be read. Add an explicit `hypervisor setup-bridge`
override for operators who need to allow stale SB reads against
relay-backed deployments.

Assisted-By: Codex (GPT-5-4)
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
@gboutry gboutry force-pushed the feat/safe-bridge-rename branch from ca29cc9 to f600783 Compare April 9, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants